#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int digit_sum(int m)
{
	int sum = 0;
	while (m)
	{
		sum += m % 10;
		m /= 10;
	}
	return sum;
}
int main()
{
	int m;
	scanf("%d", &m);
	int ret = digit_sum(m);
	printf("%d", ret);
	return 0;
}